<?php

	$site_root = "";
	require_once ($site_root . "common/PinSQL.obj");
	$pinSQL = new PinSQL();
	$pinSQL2 = new PinSQL();
	
	$pinSQL->Query("SELECT * FROM songdata");
	while ($row = $pinSQL->FetchNextRow())
	{
		$id = $row['id'];
		$name_safe = addslashes( $row['name'] );
		echo "$id is associated with $name_safe\n<br>";
		
		$pinSQL2->Query("UPDATE songcomments SET itemid='$id' WHERE name='$name_safe'");
	}
	
	$pinSQL->Query("SELECT * FROM picturedata");
	while ($row = $pinSQL->FetchNextRow())
	{
		$id = $row['id'];
		$name_safe = addslashes( $row['name'] );
		echo "$id is associated with $name_safe\n<br>";
		
		$pinSQL2->Query("UPDATE picturecomments SET itemid='$id' WHERE name='$name_safe'");
	}
	
	$pinSQL->Query("SELECT * FROM blogdata");
	while ($row = $pinSQL->FetchNextRow())
	{
		$id = $row['id'];
		$name_safe = addslashes( $row['name'] );
		echo "$id is associated with $name_safe\n<br>";
		
		$pinSQL2->Query("UPDATE blogcomments SET itemid='$id' WHERE name='$name_safe'");
	}
	
?>